package com.sikaryofficial.auth.form.mapping;

import com.sikaryofficial.auth.form.RegisterChannelBody;
import com.sikaryofficial.auth.form.RegisterH5Body;
import com.sikaryofficial.system.api.domain.SysUser;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @author : qinjinyuan
 * @desc : 文章banner映射接口
 * @date : 2023/11/03 9:19
 */
@Mapper
public interface RegisterMapping {
    RegisterMapping INSTANCE = Mappers.getMapper(RegisterMapping.class);

    /**
     * 实体映射resp
     *
     * @param req
     * @return
     */
    @Mapping(source = "shortUserName", target = "userName")
    @Mapping(source = "emailAddress", target = "email")
    @Mapping(source = "phoneNumber", target = "phonenumber")
    SysUser coverToEntity(RegisterH5Body req);

    @Mapping(source = "shortUserName", target = "userName")
    @Mapping(source = "emailAddress", target = "email")
    @Mapping(source = "phoneNumber", target = "phonenumber")
    SysUser coverChannelToEntity(RegisterChannelBody req);


}
